﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;

namespace Wutos.Domain
{
    public class IEntity<TEntity>
    {
        public void Create()
        {
            var entity = this as ICreationAudited;
            //entity.id = Common.GuId();
            entity.addtime = DateTime.Now;
        }
        public void Modify(int keyValue)
        {
            var entity = this as IModificationAudited;
            entity.id = keyValue;
            entity.mtime = DateTime.Now;
        }
    }

    public interface IModificationAudited
    {
        int id { get; set; }
        DateTime mtime { get; set; }
    }

    public interface ICreationAudited
    {
        int id { get; set; }
        DateTime addtime { get; set; }
    }
}
